<template>
  <div class="app-container bg-gray">
    <el-card class="box-1">
      <div slot="header"><span>考试信息</span></div>
      <el-form :model="form" label-width="160px">
        <el-form-item label="封面图片">
          <el-image :src="form['banner']" :preview-src-list="[form['banner']]" style="width: 188px; height: 100px;"/>
        </el-form-item>
        <el-form-item label="姓名">
          {{ form['verify_user_name'] }}
        </el-form-item>
        <el-form-item label="性别">
          {{ form['verify_time'] }}
        </el-form-item>
        <el-form-item label="出生年月日">
          {{ form['member_name'] }}
        </el-form-item>
        <el-form-item label="身份证号码">
          {{ form['member_name'] }}
        </el-form-item>
        <el-form-item label="手机">
          {{ form['member_phone'] }}
        </el-form-item>
        <el-form-item label="邮箱">
          {{ form['admin_name'] }}
        </el-form-item>
        <el-form-item label="部门">
          {{ form['goods_name'] }}
        </el-form-item>
        <el-form-item label="分组">
          {{ form['goods_name'] }}
        </el-form-item>
        <div style="text-align:center">
          <el-button v-if="queryMatch(190)" type="primary" class="bg-green" @click="toAnswerSheet">查看统计分析</el-button>
          <el-button type="info" @click="$router.back(-1)">返回</el-button>
        </div>
      </el-form>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      title: '',
      // imageUrl: this.$store.getters.serverUrl,
imageUrl: '',
      form: {
        pic_list_url: []
      }
    }
  },
  watch: {},
  created() {
    this.id = this.$route.query.id
    this.getData()
  },
  methods: {
    getData() {
      const url = 'achievement/detail/' + this.id
      this.$store.dispatch('GetConnect', { url }).then(res => {
        this.form = res.data
        this.form.pic_list_url = []
        res.data.sale_proof.forEach(item => {
          this.form.pic_list_url.push({ id: item, 'url': this.imageUrl + item })
        })
      }).catch(e => {
        this.$message.error(e.msg + ',请刷新或联系管理员')
      })
    },

    toAnswerSheet(id) {
      this.$router.push({
        path: '/exam/answerSheet',
        query: { id: id }
      })
    }
  }
}
</script>

<style lang="scss" type="text/scss" scoped>
@import '../../../../styles/index.scss';
.box-1 {
  max-width: 1000px;
  margin: 0 auto;
  > div span {
    font-size: 18px;
    font-weight: 600;
    padding: 0 10px;
  }
  .el-form {
    max-width: 900px;
    .title {
      font-weight: 600;
    }
    .remark {
      font-size: 13px;
      color: $textGray;
    }
    .el-button {
      width: 20%;
      min-width: 160px;
    }
  }
}
.el-checkbox {
  margin-right: 30px;
}
.el-checkbox + .el-checkbox {
  margin-left: 0;
  margin-right: 30px;
}
</style>
